﻿@model IEnumerable<Project5.Models.ResponseModel>
@{
    ViewBag.Title = "Details";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/responses.js")"></script>
<script type="text/javascript">
    google.load('visualization', '1.0', { 'packages': ['corechart'] });
</script>

<h2>Survey: @ViewBag.SurveyName</h2>
<h5>By: @ViewBag.SurveyOriginator</h5>

<h2>Details</h2>
<div id="responses_div"></div>

@if (Model != null)
{
    foreach (var item in Model)
    {
        <script type="text/javascript">addResponse(@item.QuestionId, "@item.QuestionText", @item.Type, "@item.Response")</script>
    }
    
    <script type="text/javascript">drawPieCharts()</script>
    <script type="text/javascript">drawBarCharts()</script>
    <script type="text/javascript">drawTables()</script>
}


